package com.cskaoyan.mall.handler.exceptionhandler;

import com.cskaoyan.mall.bean.vo.ResultVO;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class AuthHandler {
    @ExceptionHandler(AuthorizationException.class)
    @ResponseBody
    public ResultVO handlerAuthorizationException(Exception e){
        return ResultVO.error(506, "没有权限进行该操作");
    }
}
